import { Router } from 'hyper-express';
import requireUser from '../../../middlewares/auth/requireUser';
import cache from '../../../middlewares/cache';
import rowLevelPermission from '../../../middlewares/auth/rowLevelPermission';
//#region AutoCreateCode
import { uctooWechatopenUsersController } from '../../../controllers';
const uctoowechatopenUsersRouter = new Router();
const wechatopenUsersController = new uctooWechatopenUsersController();

uctoowechatopenUsersRouter.post('/add', requireUser, wechatopenUsersController.add);
uctoowechatopenUsersRouter.post('/edit', requireUser, rowLevelPermission('uctoo/wechatopen_users'), wechatopenUsersController.edit);
uctoowechatopenUsersRouter.post('/del', requireUser, rowLevelPermission('uctoo/wechatopen_users'), wechatopenUsersController.delete);

//For getting wechatopenUsers with permission control
uctoowechatopenUsersRouter.get('/:id', requireUser,  rowLevelPermission('uctoo/wechatopen_users'), wechatopenUsersController.getSingle);
uctoowechatopenUsersRouter.get('/:limit/:page', requireUser,  rowLevelPermission('uctoo/wechatopen_users'), wechatopenUsersController.getMany);
uctoowechatopenUsersRouter.get('/:limit/:page/:skip', requireUser,  rowLevelPermission('uctoo/wechatopen_users'), wechatopenUsersController.getMany);

//#endregion AutoCreateCode
uctoowechatopenUsersRouter.get('/count', wechatopenUsersController.countUsers);
export default uctoowechatopenUsersRouter;
